import request from '@neu/biz-core/utils/request'
const baseUrl = '/notice/api/w/notification'

export const list = (params) => {
  return request({
    url: baseUrl,
    params,
    method: 'get'
  })
}

export const page = (params) => {
  return request({
    url: baseUrl + '/p',
    params,
    method: 'get'
  })
}

export const remove = (id) => {
  return request({
    url: baseUrl + '/' + id,
    method: 'delete'
  })
}

export const detail = (id) => {
  return request({
    url: baseUrl + '/' + id,
    method: 'get'
  })
}

export const update = (id, data) => {
  return request({
    url: baseUrl + '/' + id,
    data,
    method: 'put'
  })
}

export const current = () => {
  return request({
    url: baseUrl + '/current/unread',
    method: 'get'
  })
}

export const noticeType = () => {
  return request({
    url: baseUrl + '/noticeType',
    method: 'get'
  })
}

export const batchRead = (data) => {
  return request({
    url: baseUrl + '/batchRead',
    data,
    method: 'put'
  })
}

export const batchRemove = (codes) => {
  return request({
    url: baseUrl + '/batch/' + codes,
    method: 'delete'
  })
}

export const clear = () => {
  return request({
    url: baseUrl + '/clear',
    method: 'delete'
  })
}

export const ignore = () => {
  return request({
    url: baseUrl + '/ignore',
    method: 'put'
  })
}

